package ducna.misscall.screen.splash;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;
import ducna.alozo.misscall.R;
import ducna.misscall.common.BaseActivity;
import ducna.misscall.screen.main.MainActivity;

public class SplashActivity extends BaseActivity{
	
	private final static int DELAY_TIME = 3000;

	private ImageView imageViewSplashScreen;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		
		imageViewSplashScreen = (ImageView) findViewById(R.id.imageViewSplashScreen);
		imageViewSplashScreen.setImageResource(R.drawable.splash);
		new Handler().postDelayed(new Runnable() {
			
			@Override		
			public void run() {
				Intent i = new Intent(SplashActivity.this, MainActivity.class);
				startActivity(i);
				finish();
			}
		}, DELAY_TIME);
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		imageViewSplashScreen.setImageBitmap(null);
		imageViewSplashScreen = null;
	}
}
